package com.dragon.mmochat.model.enumType;

//注：一旦发版,如果此enum会存到数据库，则此类型只能增加,不能减少或修改名字
public enum MmochatFamilyType {
	阐教(0, "蜀山"), 人教(1, "昆仑"), 截教(2, "拜月");

	int value;
	String name;

	MmochatFamilyType(int value, String name) {
		this.value = value;
		this.name = name;
	}

	public int getValue() {
		return value;
	}

	public void setValue(int value) {
		this.value = value;
	}

	public String getName() {
		return name;
	}

	public static MmochatFamilyType get(int value) {
		for (MmochatFamilyType type : MmochatFamilyType.values()) {
			if (type.getValue() == value) {
				return type;
			}
		}
		return null;
	}

	public static MmochatFamilyType getByIndex(int index) {
		int curIndex = 0;
		for (MmochatFamilyType type : MmochatFamilyType.values()) {
			if (curIndex == index) {
				return type;
			}
			curIndex++;
		}
		return null;
	}
}
